#include <iostream>
#include "MiRpc.h"

void foo(void* arg1, void* ex, void* arg3)
{
    RdmaRpc* self = (RdmaRpc*)arg1;
    std::cout << "Hello World!" << std::endl;
    self->RpcServiceComplete((struct RpcExecution* )ex);
    
}
int main()
{
    RdmaRpc server_rpc;
    server_rpc.Init(NULL, 0, 128 << 10, RPC_SHARED_RECV_QUEUE|RPC_SERVER);
    if(server_rpc.BindSess("10.0.0.37:12345")<0)
    {
        std::cout << "Failed to Bind" << std::endl;
    }
    server_rpc.RpcServiceRegister(0, foo);
    while(1)
    {
        server_rpc.AcceptSess();
        server_rpc.RpcServerHandleRx();
        server_rpc.RpcServerHandleTx();
    }
    return 0;
}
